<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title>Ritter</title>
    <%= stylesheet_link_tag 'forms', 'grid', 'reset', 'typography', 'scaffold' %>
    <%= javascript_include_tag :defaults %>
  </head>
  <body>
    <div class="container">
      <div id="header">
        <div id="account" class="prepend-14 span-4 end">
          <% if !current_user %>
            <%= link_to "Login", new_user_session_path %> or
            <%= link_to "Register", new_account_path %>
          <% else %>
            Hi, <%=current_user.login%>!
            <%= link_to "Logout", user_session_path, :method => :delete %>
          <% end %>
        </div>
      </div>
      <ul id="menu">
        <% if !current_user %>
          <li><%= link_to "All Writs", writs_path %></li>
          <li><%= link_to "Login", new_user_session_path %></li>
          <li><%= link_to "Register", new_account_path %></li>
        <% else %>
          <li><%= link_to "My Writs", user_writs_path(current_user) %></li>
          <li><%= link_to "All Writs", writs_path %></li>
          <li><%= link_to "Edit Account", edit_account_path %></li>
          <li><%= link_to "Logout", user_session_path, :method => :delete %></li>
        <% end %>
      </ul>
      <% if flash[:notice] %>
        <p id="notice"><%= flash[:notice] %></p>
      <% end %>
      <div id="content" class="span-18 last">
        <div id="main-content" class="prepend-1 span-11 colborder">
          <%= yield  %>
        </div>
        <div id="sub-content" class="span-3 append-1 end">
          <div class="box">
          <% if current_user && !current_user.leaders.empty? %>
            <h2>Leaders</h2>
            <%@leaders = current_user.leaders%>
             <%=render :layout => "leaders/leaders.html", :object => @leaders%>
          <% end %>
          </div>

          <div class="box">
          <% if current_user && !current_user.followers.empty?%>
            <h2>Followers</h2>
            <%@followers = current_user.followers%>
             <%=render :layout => "followers/followers.html", :object => @followers%>
          <% end %>
          </div>
        </div>
      </div>
      <hr />
      <div id="footer">
        <p id="credits">Created by: Allen Madsen, Daniel Giorgetti, Victor Calderon, Jeremy Leakakos, and Edward Louw</p>
      </div>
    </div>
  </body>
</html>
